// Media objects
// Source: http://stubbornella.org/content/?p=497
// --------------------------------------------------

$media-color: $text-color;
$media-image-width: 48px;
$media-image-width-sm: 32px;
$media-gutter: 10px;
$media-font-size-h1: ($font-size-base + 2);
$media-font-size-h2: $font-size-base;

.media {
  display: table;
  width: 100%;
  padding-bottom: 5px;
  margin-bottom: $line-height-base;
  // border-bottom: 1px solid transparentize($media-color, .9);

  &:last-child {
    padding-bottom: 0;
    // border-bottom: 1px solid transparent;
  }

  small {
    font-size: $font-size-small;
  }

  &.panel {
    padding: 10px;
  }
}

.media-object,
.media-body {
  display: table-cell;
  vertical-align: top;
}

.media-object {
  padding-right: $media-gutter;

  img {
    display: block;
    width: $media-image-width;
    max-width: none;
    height: auto;
    border-radius: $border-radius-base;
  }

  &.right-align {
    padding-right: 0;
    padding-left: $media-gutter;
  }
}

.media-body {
  width: 100%;

  h1,
  h2 {
    margin-top: .2em;
    margin-bottom: .5em;
    font-size: $media-font-size-h1;

    a {
      color: $gray-dark;

      &:hover {
        color: lighten($gray-dark, 20%);
      }

      &.text-muted {
        color: $text-muted;
      }
    }
  }

  h2 {
    margin-top: 5px;
    font-size: $media-font-size-h2;
  }

  p {
    // margin-bottom: .5em;
    white-space: pre-wrap;
  }
}

.media-sm {
  .media-object {
    img {
      width: $media-image-width-sm;
    }
  }

  .media-body {
    h1 {
      font-size: $font-size-base;
    }
  }
}

.media-body-footer {
  // margin: 10px -15px 5px;
  // padding: 5px 15px 1px;
  padding: 10px 0;
  border-top: 1px solid #ccc;
}

.media-body-attachment {
  padding-top: 10px;
  border-top: 1px solid #ccc;
}

.media-comments {
  // margin: 0 -15px;
  padding: 10px;
  background-color: #f1f1f1;
  border-top: 1px solid #e5e5e5;
  box-shadow: none;

  h1 {
    margin-top: .1em;
  }
}
